package cn.wolfcode.luowowo.common.util;

import cn.wolfcode.luowowo.common.exception.DisableException;

/**
 * 断言工具类
 */
public class AssertUtil {
    /**
     * 判断value值是否相等
     */
    public static void hasLength(String value,String msg){
        if(value == null || "".equals(value.trim())){
            throw new DisableException(msg);
        }
    }
    /**
     * 判断传入的两个参数是否相等
     */
    public static void isEquals(String value1,String value2,String msg){
        if(value1 == null || value2 == null){
            throw new DisableException("传入参数不能为空");
        }

        if(!value1.equals(value2)){
            throw new DisableException(msg);
        }
    }
}
